<?php

/**
 *		//统一入口的ajax调用//
 *		//这是一份试验品，地宝网5毛管理系统，由大街编写（zhongmingzi@gmail.com）
 *		//本程序默认环境：Zend Optimizer Yes / 3.3.3
 *		//		Apache/2.0.63 (Win32) PHP/5.2.12
 *		//		MySQL 支持 Yes / client lib version 5.0.89
 *		//		GD library Yes / bundled (2.0.34 compatible)
 *		//		eAccelerator/Memcache/xcache Yes
 *		//		cURL support enabled
 *		//时间：2011-01-17//
 */
define('CURSCRIPT', 'ajax_api');

require_once './source/class/class_core.php';

$lab = & core::instance();
$lab->init();

require_once libfile('function/task');
$action = getgpc('action');
if(!in_array($action, array( 'okuser', 'deluser','applytask','deltask', 'delthreadtask','oktask','nottask','delbd','okpost','delpost'))) {
	$action = '';
}
empty($action) && exit('Access Denied');

$key_array = array(
					'action','formhash',
					'id','type','uid',//审核用户
					'lid',
					'taskid',
				);
foreach($_POST as $key => $v) {
		$$key = $v;
		if(!in_array($key, $key_array)) unset($$key);
}

if($action == 'okuser') {
	verifyuid($id, true);
	exit($id);
} elseif($action == 'deluser') {
	verifyuid($id, false);
	exit($id);
} elseif($action == 'applytask') {
	$apid = applytask($id, $type);
	if( $apid == 1) exit($id);
	elseif ($apid == -1) exit('over'.$id);
} elseif($action == 'deltask') {
	if(deltask($id, $type)) exit($id);
} elseif($action == 'delthreadtask') {
	if(deltaskurl($id, $uid)) exit($id);
} elseif($action == 'oktask') {
	if(verifytask($lid)) exit($lid);
} elseif($action == 'nottask') {
	if(verifytask($lid, false)) exit($lid);
} elseif($action == 'delbd') {
	if(unbinduser($id)) exit($id);
} elseif($action == 'okpost') {
	if(verifypost($taskid, $uid, true)) exit($uid);
}



?>
